﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Ucb.Workshop.Business;
using Ucb.Workshop.Dal;

namespace Ucb.Workshop.WinApp.View.GestionVentas
{
    public partial class VentaOpc : UserControl
    {
        public VentaOpc()
        {
            InitializeComponent();
        }

       

        private void comboBoxTipoVenta_SelectedIndexChanged(object sender, EventArgs e)
        {
            Venta buscarVenta = new Venta();
            string tipoVenta, consulta;
            DataSet miDataSet = new DataSet();
            DBManager conexion = new DBManager();
            if (comboBoxTipoVenta.Text == "Confirmada")
            {
                tipoVenta = "Confirmada";
                consulta = string.Format("SELECT * FROM venta WHERE estadoVenta='{0}';", tipoVenta);
                conexion.LlenarGrid(dataGridViewVenta, consulta);
                dataGridViewVenta.Columns[0].Visible = false;

            }
            else
            {
                tipoVenta = "Anulada";
                consulta = string.Format("SELECT * FROM venta WHERE estadoVenta='{0}';", tipoVenta);
                conexion.LlenarGrid(dataGridViewVenta, consulta);
                dataGridViewVenta.Columns[0].Visible = false;
            }

        }
    }
}
